Skip to content

Add soft-fail-version-check toggle to warn (not error) on untested Swift versions #745

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

escii
Copy link

@escii escii commented Jun 30, 2025

This PR introduces a new boolean input, soft-fail-version-check, which defaults to false. When set to true, the action will:

  • Emit a warning instead of throwing an error when the requested Swift version isn’t found in the list of tested versions.
  • Attempt to download/install the exact version string provided

This makes it possible to consume patch/minor releases (e.g. 6.1.1) as soon as they’re available upstream, without having to wait for the action’s static list to be updated. #743 #706 #683 #672

Changes:
action.yml

  • Added soft-fail-version-check input (default: false)

src/swift-versions.ts

  • Read soft-fail-version-check via core.getInput(...)
  • In verify(...), replace the hard error on missing version with:
if (softFailVersionCheck) {
  core.warning(
    `Swift version "${version}" not in the list of tested versions; proceeding anyway because soft-fail-version-check is enabled.`
  );
  return version;
}
throw new Error(`Version "${version}" is not available`);

Tests:
Added a matrix job in our test workflow to verify all three behaviors:

  • Default (fails on unknown versions)
  • With soft-fail-version-check: true (warns and proceeds)
  • With soft-fail-version-check: true (warns and proceeds) but then fails because the version 6.1.6 does not exist.

You can see the matrix runs here:
https://github.com/sonderformat-llc/setup-swift-test/actions/runs/15975074977

@escii escii marked this pull request as ready for review June 30, 2025 14:28
@Aaron-Ritter
Copy link

@fwal what do you think about this workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants